<div class="portlet">
  <div class="portlet-header">
    <h1><%=t "advanced_search_title"%></h1>
  </div>
  <div class="portlet-content">
    <!--div class="container"-->
      <% form_tag catalogs_advanced_search_path, :method => 'get' do %>
    <table style="border: none">
          <tr>
            <td>
              <%= label_tag t('activerecord.attributes.material.title') %>
            </td>
            <td colspan="4">
              <%= text_field_tag :advance_search_title, nil, {:size => 50}  %>
            </td>
          </tr>
          <tr>
            <td>
              <%= label_tag t('activerecord.models.author') %>
            </td>
            <td colspan="4">
              <%= text_field_tag :advance_search_author, nil, {:size => 50} %>
            </td>
          </tr>
          <tr>
            <td>
              <%= label_tag t('activerecord.models.publisher') %>
            </td>
            <td colspan="4">
              <%= text_field_tag :advance_search_publisher, nil, {:size => 50} %>
            </td>
          </tr>
          <tr>
            <td>
              <%= label_tag t('activerecord.models.country') %>
            </td>
            <td colspan="4">
              <%=select_tag(:advance_search_country, options_for_select([[t("lbl_all_m"), ""]] + Country.find(:all, :conditions => "use_for_sale = true", :order => "name").collect {|c| [ c.name, c.name ] })) %>
            </td>
          </tr>
          <tr>
            <td>
              <%= label_tag t('activerecord.attributes.material.edition_year') %>
            </td>
            <td colspan="4">
              <%= text_field_tag :advance_search_year_search %>
            </td>
          </tr>
          <tr>
            <td>
              <%= label_tag t('activerecord.attributes.material.isbn') %>
            </td>
            <td colspan="4">
              <%= text_field_tag :advance_search_isbn %>
            </td>
          </tr>
          <tr>
            <td>
              <%= label_tag t('activerecord.models.descriptor') %>
            </td>
              <td>
                <%= text_field_tag 'descriptor1', '' %>
                <%#= image_tag("load.gif", :align => "absmiddle", :border => 0, :id => "descriptor_spinner", :style =>"display: none;" ) %>
                <div class="auto_complete" id="descriptor1_auto_complete"></div>
              </td>
              <td>
                <%=select_tag('connector1', options_for_select( %w{OR AND})) %>
              </td>
              <td>
                <%= text_field_tag 'descriptor2' %>
                <%#= image_tag("load.gif", :align => "absmiddle", :border => 0, :id => "descriptor2_spinner", :style =>"display: none;" ) %>
                <div class="auto_complete" id="descriptor2_auto_complete" ></div>
              </td>
              <td>
                <%=select_tag('connector2', options_for_select( %w{OR AND})) %>
              </td>
              <td>
                <%= text_field_tag 'descriptor3' %>
                <%#= image_tag("load.gif", :align => "absmiddle", :border => 0, :id => "descriptor3_spinner", :style =>"display: none;" ) %>
                <div class="auto_complete" id="descriptor3_auto_complete" ></div>
              </td>
          </tr>
        </table>
        <br/>
        <div class="line-buttons" style="text-align: left">
          <%= submit_tag t('btn_advanced_search'), :name => nil %>
        </div>

      <% end %>
    <!--/div-->
  </div>
</div>

<%= auto_complete_field 'descriptor1',
  :url=>{:controller => 'catalogs', :action=>'auto_complete_descriptor'},
  :frequency => 0.5,
  :min_chars => 3
  #:indicator => 'descriptor_spinner'
%>

<%= auto_complete_field 'descriptor2',
  :url=>{:controller => 'catalogs', :action=>'auto_complete_descriptor'},
  :frequency => 0.5,
  :min_chars => 3
  #:indicator => 'descriptor2_spinner'
%>

<%= auto_complete_field 'descriptor3',
  :url=>{:controller => 'catalogs', :action=>'auto_complete_descriptor'},
  :frequency => 0.5,
  :min_chars => 3
  #:indicator => 'descriptor3_spinner'
%>

